package com.dongjiantong.farmrecords.mapper;

import com.dongjiantong.farmrecords.model.FarmRecordsDiagnosis;
import com.dongjiantong.mybatis.MyMapper;

import java.util.List;
import java.util.Map;

public interface FarmRecordsDiagnosisMapper extends MyMapper<FarmRecordsDiagnosis> {
    /**
     * 根据条件查询记录
     * @param map
     * @return
     */
    List<FarmRecordsDiagnosis> selectByMap(Map map);

    /**
     * 新增一条记录
     * @param
     * @return
     */
    int createOne(FarmRecordsDiagnosis farmRecordsDiagnosis);

    String findMaxNumber(String prefix);

    /**
     * 养殖端按照单据状态分页查询列表
     * @param map
     * @return
     */
    List<FarmRecordsDiagnosis> selectListByStatus(Map<String, Object> map);

    /**
     * 根据条件查询单个记录
     * @param map
     * @return
     */
    FarmRecordsDiagnosis selectOneByMap(Map<String, Object> map);

    /**
     * 根据牛档案关联单据Ids 查询诊疗次数
     * @param
     * @return
     */
    List<Map<String, Object>> selectDiagnosisCount(Map<String,Object> map);

    /**
     * 牛档案列表 诊疗期次顺序排
     * @param map
     * @return
     */
    List<FarmRecordsDiagnosis> selectListCow(Map<String, Object> map);

    Integer updateEarNumberByCowRelateId(Map<String, Object> map);
}